import { createSlice } from '@reduxjs/toolkit';

// 使用该类型定义初始 state
const initialState = {
  list: [],
};

const slice = createSlice({
  name: 'cinema',
  initialState,
  reducers: {
    changeCinemaList(state, action = { payload: [] }) {
      state.list = action.payload || [];
    },
    clearCinemaList(state) {
      state.list = [];
    },
  },
});

export const { changeCinemaList, clearCinemaList } = slice.actions;
export default slice.reducer;
